package com.study.enums;

/**
 * HTTP状态码枚举
 */
public enum HttpStatusEnum {

    SUCCESS(200, "操作成功"),

    ERROR(400, "操作失败"),

    NOT_FOUND(404, "资源未找到"),

    RESOURCE_NOT_FOUND(410, "资源不存在"),

    INVALID_PARAMETER(415, "参数错误"),

    SERVER_ERROR(500, "服务器错误"),

    NO_ROW_AFFECTED(501,"数据库操作未影响任何行");


    private final int code;
    private final String msg;


    HttpStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
